package com.ea.eadp.nexus.test.pageDefinition.pc;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

import com.ea.eadp.nexus.test.pageDefinition.BasePage;

public class CreateUnderageUserPage extends BasePage {
    
    public CreateUnderageUserPage(WebDriver driver) {
        super(driver, CreateUnderageUserPage.class);
    }
    
    public WebElement txt_originId;
    public WebElement txt_parentEmail;
    public WebElement txt_password;
    public WebElement txt_confirmPassword;
    public WebElement txt_captcha;
    public WebElement check_AcceptTOS;
    public WebElement btn_submit;
    
    public static class ControlDefinitions {
        public static By txt_originId = By.id("originId");
        public static By txt_parentEmail = By.id("parentEmail");
        public static By txt_password = By.id("password");
        public static By txt_confirmPassword = By.id("confirmPassword");
        public static By txt_captcha = By.id("recaptcha_response_field");
        public static By check_AcceptTOS = By.xpath("//li[@id='read-accept-container']/div/div/span");
        public static By btn_submit = By.id("submit-btn");
    }
    
    public void initControls() {
        this.txt_originId = driver.findElement(ControlDefinitions.txt_originId);
        this.txt_parentEmail = driver.findElement(ControlDefinitions.txt_parentEmail);
        this.txt_password = driver.findElement(ControlDefinitions.txt_password);
        this.txt_confirmPassword = driver.findElement(ControlDefinitions.txt_confirmPassword);
        this.txt_captcha = driver.findElement(ControlDefinitions.txt_captcha);
        this.check_AcceptTOS = driver.findElement(ControlDefinitions.check_AcceptTOS);
        this.btn_submit = driver.findElement(ControlDefinitions.btn_submit);
    }
    
    public void initPage() {
        waitForWebElementPresent(ControlDefinitions.btn_submit);
        initControls();
    }
    
}
